package com.xbao.dao;

import com.xbao.model.OperLog;
import com.xbao.model.OperLogExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface OperLogMapper {
    @SelectProvider(type=OperLogSqlProvider.class, method="countByExample")
    int countByExample(OperLogExample example);

    @DeleteProvider(type=OperLogSqlProvider.class, method="deleteByExample")
    int deleteByExample(OperLogExample example);

    @Delete({
        "delete from oper_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into oper_log (id, eid, bustype, ",
        "createtime, updatetime, ",
        "opertime, description)",
        "values (#{id,jdbcType=BIGINT}, #{eid,jdbcType=BIGINT}, #{bustype,jdbcType=INTEGER}, ",
        "#{createtime,jdbcType=BIGINT}, #{updatetime,jdbcType=BIGINT}, ",
        "#{opertime,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR})"
    })
    int insert(OperLog record);

    @InsertProvider(type=OperLogSqlProvider.class, method="insertSelective")
    int insertSelective(OperLog record);

    @SelectProvider(type=OperLogSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="eid", property="eid", jdbcType=JdbcType.BIGINT),
        @Result(column="bustype", property="bustype", jdbcType=JdbcType.INTEGER),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="opertime", property="opertime", jdbcType=JdbcType.BIGINT),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<OperLog> selectByExampleWithBLOBs(OperLogExample example);

    @SelectProvider(type=OperLogSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="eid", property="eid", jdbcType=JdbcType.BIGINT),
        @Result(column="bustype", property="bustype", jdbcType=JdbcType.INTEGER),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="opertime", property="opertime", jdbcType=JdbcType.BIGINT)
    })
    List<OperLog> selectByExample(OperLogExample example);

    @Select({
        "select",
        "id, eid, bustype, createtime, updatetime, opertime, description",
        "from oper_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="eid", property="eid", jdbcType=JdbcType.BIGINT),
        @Result(column="bustype", property="bustype", jdbcType=JdbcType.INTEGER),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="opertime", property="opertime", jdbcType=JdbcType.BIGINT),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    OperLog selectByPrimaryKey(Long id);

    @UpdateProvider(type=OperLogSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") OperLog record, @Param("example") OperLogExample example);

    @UpdateProvider(type=OperLogSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") OperLog record, @Param("example") OperLogExample example);

    @UpdateProvider(type=OperLogSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") OperLog record, @Param("example") OperLogExample example);

    @UpdateProvider(type=OperLogSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(OperLog record);

    @Update({
        "update oper_log",
        "set eid = #{eid,jdbcType=BIGINT},",
          "bustype = #{bustype,jdbcType=INTEGER},",
          "createtime = #{createtime,jdbcType=BIGINT},",
          "updatetime = #{updatetime,jdbcType=BIGINT},",
          "opertime = #{opertime,jdbcType=BIGINT},",
          "description = #{description,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKeyWithBLOBs(OperLog record);

    @Update({
        "update oper_log",
        "set eid = #{eid,jdbcType=BIGINT},",
          "bustype = #{bustype,jdbcType=INTEGER},",
          "createtime = #{createtime,jdbcType=BIGINT},",
          "updatetime = #{updatetime,jdbcType=BIGINT},",
          "opertime = #{opertime,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(OperLog record);
}